/*
 * @LastEditors: 杜康
 * @LastEditTime: 2021-10-04 14:18:11
 */
function factorialIterative (number) {
    if (number === 0) return undefined
    let total = 0
    for (let n = number; n > 1; n--) {
        total *= n
    }
    return total
}

console.log(factorialIterative(5))